package com.example.demo.domain.security;

import com.example.demo.domain.base.BaseEntity;

import javax.persistence.*;

/**
 * @author Jack
 * @Title: 资源表
 * @Description: 资源表实体类
 * @date 2018年1月7日14:06:41
 */
@Entity
@Table(schema = "security", name = "resource")
public class Resource extends BaseEntity {
    /* url */
    private String resourceUrl;
    /* 资源ID */
    private String resourceId;
    /* 备注 */
    private String remark;
    /* 资源名称 */
    private String resourceName;
    /* 资源所对应的方法名 */
    private String methodName;
    /* 资源所对应的包路径  */
    private String methodPath;

    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "resource_id_seq")
    @SequenceGenerator(name = "resource_id_seq", sequenceName = "security.resource_id_seq")
    public Long getId() {
        return id;
    }

    @Column(name = "resource_url")
    public String getResourceUrl() {
        return resourceUrl;
    }

    public void setResourceUrl(String resourceUrl) {
        this.resourceUrl = resourceUrl;
    }

    @Column(name = "resource_id")
    public String getResourceId() {
        return resourceId;
    }

    public void setResourceId(String resourceId) {
        this.resourceId = resourceId;
    }

    @Column(name = "remark")
    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Column(name = "resource_name")
    public String getResourceName() {
        return resourceName;
    }

    public void setResourceName(String resourceName) {
        this.resourceName = resourceName;
    }

    @Column(name = "method_name")
    public String getMethodName() {
        return methodName;
    }

    public void setMethodName(String methodName) {
        this.methodName = methodName;
    }

    @Column(name = "method_path")
    public String getMethodPath() {
        return methodPath;
    }

    public void setMethodPath(String methodPath) {
        this.methodPath = methodPath;
    }

    @Override
    public boolean valid() {
        return true;
    }
}
